from views.Aviews import userInfo,Authority,otherInfo
from views.Bviews import agency,plugin,marketing,commodity,childrenPlugin,wechatApi,childrenPlugin1,mallProgram,otherProgram
from views.Cviews import wx_userInfo,order,pluginChildren,addTherData,pluginChildren1
from views import upload
A_API = '/basic-api'
C_API = '/basic-capi'
A_API_authority = '/basic-api/authority'
def url_router():
    Apublic = [
        # (userInfo.Alogin.as_view(), '/login/<id>')  # 获取路由参数
        (userInfo.A_Login.as_view(), A_API+'/login'), 
    ]
    Aauthority = [
        # 用户角色操作
        (userInfo.A_userInfo.as_view(),  A_API+'/person'),
        (userInfo.A_tree.as_view(),  A_API+'/tree'),
        (userInfo.A_source.as_view(),  A_API+'/source'),
        (userInfo.A_boutton.as_view(),  A_API+'/button'),
        (userInfo.A_role.as_view(),  A_API+'/roleList'),
        (userInfo.A_updateUserInfo.as_view(),  A_API+'/update_person'),
        (userInfo.A_userList.as_view(),  A_API+'/adminUserList'),
        (userInfo.A_userDel.as_view(),  A_API+'/adminUserDelete'),
        (userInfo.A_person_add.as_view(),  A_API+'/adminUserAdd'),
        (userInfo.adminUserUpdate.as_view(),  A_API+'/adminUserUpdate'),
        (userInfo.allocation_menus.as_view(),  A_API+'/allocation_menus'),
        (userInfo.dashboard.as_view(),  A_API+'/dashboard'),
        # 角色权限
        (Authority.addmemu.as_view(),  A_API_authority+'/addmemu'),
        (Authority.memulist.as_view(),  A_API_authority+'/menulist'),
        (Authority.memudel.as_view(),  A_API_authority+'/memudel'),
        (Authority.memuupdate.as_view(),  A_API_authority+'/memuupdate'),
        (Authority.rolelist.as_view(),  A_API+'/rolelist'),
        (Authority.roleadd.as_view(),  A_API+'/roleadd'),
        (Authority.roledel.as_view(),  A_API+'/roledel'),
        (Authority.roleedit.as_view(),  A_API+'/roleedit'),
        (Authority.allocation_users.as_view(),  A_API+'/allocation_users'),
        (Authority.operation_log.as_view(),  A_API+'/operation_log'),
        (Authority.error_log.as_view(),  A_API+'/error_log'),
        (Authority.distribution_menu.as_view(),  A_API+'/distribution_menu'),
        (Authority.validate_menu.as_view(),  A_API+'/permission/menu/validate'),
        (Authority.validate_switch.as_view(),  A_API+'/permission/menu/validate_switch'),
    ]
    Aprivate = [
        (otherInfo.forbiddenWhite.as_view(), A_API + '/white'),
    ]

    Bauthority = [
        (agency.DashboardAgency.as_view(),  A_API+'/dashboard/agency'),

        (wechatApi.wechatList.as_view(), A_API + '/wechatApi/wechatList'),
        (wechatApi.wechatDelete.as_view(), A_API + '/wechatApi/wechatDelete'),
        (wechatApi.setAddress.as_view(), A_API + '/wechatApi/setAddress'),
        (wechatApi.findAddress.as_view(), A_API + '/wechatApi/findAddress'),

        (marketing.other_type_add.as_view(),  A_API+'/other_type/add'),
        (marketing.other_type_list.as_view(),  A_API+'/other_type/list'),
        (marketing.other_type_del.as_view(),  A_API+'/other_type/delete'),
        
        (commodity.typeAdd.as_view(),  A_API+'/commodity/category/add'),
        (commodity.typeEdit.as_view(),  A_API+'/commodity/category/edit'),
        (commodity.typeList.as_view(),  A_API+'/commodity/category/list'),
        (commodity.typeDelete.as_view(),  A_API+'/commodity/category/delete'),
        (commodity.typeOption.as_view(),  A_API+'/commodity/category/typeOption'),
        (commodity.typeSetData.as_view(),  A_API+'/commodity/category/typeSetData'),
        (commodity.goodsAdd.as_view(),  A_API+'/commodity/goods/add'),
        (commodity.goodsEdit.as_view(),  A_API+'/commodity/goods/edit'),
        (commodity.goodsList.as_view(),  A_API+'/commodity/goods/list'),
        (commodity.goodsDelete.as_view(),  A_API+'/commodity/goods/delete'),
        (commodity.goodsDetails.as_view(),  A_API+'/commodity/goods/goodsDetails'),
        (commodity.businessAdd.as_view(),  A_API+'/commodity/business/add'),
        (commodity.businessList.as_view(),  A_API+'/commodity/business/list'),
        (commodity.businessDel.as_view(),  A_API+'/commodity/business/delete'),
        (commodity.businessEdit.as_view(),  A_API+'/commodity/business/edit'),
        (commodity.placeAnOrder.as_view(),  A_API+'/commodity/order/placeAnOrder'),
        (commodity.orderList.as_view(),  A_API+'/commodity/order/list'),
        (commodity.orderEdit.as_view(),  A_API+'/commodity/order/edit'),
        (commodity.orderDel.as_view(),  A_API+'/commodity/order/delete'),
        (commodity.orderDetails.as_view(),  A_API+'/commodity/order/details'),
        (commodity.order_logs.as_view(),  A_API+'/commodity/order/order_log'),
        # 商品标签
        (commodity.goodsLabelList.as_view(),  A_API+'/commodity/goods/goodsLabelList'),
        (commodity.goodsLabelAdd.as_view(),  A_API+'/commodity/goods/goodsLabelAdd'),
        (commodity.goodsLabelDel.as_view(),  A_API+'/commodity/goods/goodsLabelDel'),
        (commodity.goodsLabelEdit.as_view(),  A_API+'/commodity/goods/goodsLabelEdit'),
        # 商品标签分组
        (commodity.goodsGroupList.as_view(), A_API + '/commodity/goods/goodsGroupList'),
        (commodity.goodsGroupAdd.as_view(), A_API + '/commodity/goods/goodsGroupAdd'),
        (commodity.goodsGroupDel.as_view(), A_API + '/commodity/goods/goodsGroupDel'),
        (commodity.goodsGroupEdit.as_view(), A_API + '/commodity/goods/goodsGroupEdit'),
        (commodity.goodsLabelOptions.as_view(), A_API + '/commodity/goods/goodsLabelOptions'),
        # 商品规格模版
        (commodity.goodsSkuTemplateList.as_view(), A_API + '/commodity/goods/goodsSkuTemplateList'),
        (commodity.goodsSkuTemplateAdd.as_view(), A_API + '/commodity/goods/goodsSkuTemplateAdd'),
        (commodity.goodsSkuTemplateDel.as_view(), A_API + '/commodity/goods/goodsSkuTemplateDel'),
        (commodity.goodsSkuTemplateDetails.as_view(), A_API + '/commodity/goods/goodsSkuTemplateDetails'),
        (commodity.useCoupons.as_view(), A_API + '/commodity/coupons/useCoupons'),
        # 保障服务
        (otherProgram.goodsServiceGuaranteeList.as_view(), A_API + '/otherProgram/goods/goodsServiceGuaranteeList'),
        (otherProgram.goodsServiceGuaranteeAdd.as_view(), A_API + '/otherProgram/goods/goodsServiceGuaranteeAdd'),
        (otherProgram.goodsServiceGuaranteeDel.as_view(), A_API + '/otherProgram/goods/goodsServiceGuaranteeDel'),
        (otherProgram.goodsServiceGuaranteeEdit.as_view(), A_API + '/otherProgram/goods/goodsServiceGuaranteeEdit'),

        (plugin.pluginAdd.as_view(), A_API + '/plugin/add'),
        (plugin.pluginList.as_view(), A_API + '/plugin/list'),
        (plugin.pluginDelete.as_view(), A_API + '/plugin/delete'),
        (plugin.pluginUpdate.as_view(), A_API + '/plugin/update'),
        (plugin.pluginMyPlugin.as_view(), A_API + '/plugin/myPlugin'),
        (plugin.pluginUserPlugin.as_view(), A_API + '/plugin/userPlugin'),
        (plugin.pluginOtherUserPlugin.as_view(), A_API + '/plugin/pluginOtherUserPlugin'),
        (plugin.checkPlugin.as_view(), A_API + '/plugin/checkPlugin'),

        (childrenPlugin.themeAdd.as_view(), A_API + '/theme/update'),
        (childrenPlugin.themeList.as_view(), A_API + '/theme/list'),
        (childrenPlugin.main_activeList.as_view(), A_API + '/main_active/list'),
        (childrenPlugin.main_activeAdd.as_view(), A_API + '/main_active/add'),
        (childrenPlugin.main_activeDelete.as_view(), A_API + '/main_active/delete'),
        (childrenPlugin.main_activeUpdate.as_view(), A_API + '/main_active/update'),
        (childrenPlugin.bannerAdd.as_view(), A_API + '/banner/add'),
        (childrenPlugin.bannerList.as_view(), A_API + '/banner/list'),
        (childrenPlugin.bannerDelete.as_view(), A_API + '/banner/delete'),
        (childrenPlugin.bannerUpdate.as_view(), A_API + '/banner/update'),
        (childrenPlugin.noticeAdd.as_view(), A_API + '/notice/add'),
        (childrenPlugin.noticeList.as_view(), A_API + '/notice/list'),
        (childrenPlugin.noticeDelete.as_view(), A_API + '/notice/delete'),
        (childrenPlugin.noticeUpdate.as_view(), A_API + '/notice/update'),
        (childrenPlugin.rechargeshow.as_view(), A_API + '/rechargeshow/list'),
        (childrenPlugin.rechargeshowAdd.as_view(), A_API + '/rechargeshow/add'),
        (childrenPlugin.rechargeshowDelete.as_view(), A_API + '/rechargeshow/delete'),
        (childrenPlugin.rechargeshowUpdate.as_view(), A_API + '/rechargeshow/update'),
        (childrenPlugin.find_user.as_view(), A_API + '/rechargeshow/find_user'),
        (childrenPlugin.rechargerecord.as_view(), A_API + '/rechargerecord/recharge'),

        # 充值会员的列表
        (childrenPlugin.memberChargeAdd.as_view(), A_API + '/memberCharge/add'),
        (childrenPlugin.memberChargeList.as_view(), A_API + '/memberCharge/list'),
        (childrenPlugin.memberChargeDel.as_view(), A_API + '/memberCharge/delete'),
        (childrenPlugin.memberChargeUpdate.as_view(), A_API + '/memberCharge/update'),

        (childrenPlugin1.setMealAdd.as_view(), A_API + '/setMeal/add'),
        (childrenPlugin1.setMealList.as_view(), A_API + '/setMeal/list'),
        (childrenPlugin1.setMealDel.as_view(), A_API + '/setMeal/delete'),
        (childrenPlugin1.setMealUpdate.as_view(), A_API + '/setMeal/update'),
        (childrenPlugin1.shoppingCartList.as_view(), A_API + '/shoppingCart/list'),
        (childrenPlugin1.shoppingCartAdd.as_view(), A_API + '/shoppingCart/add'),
        (childrenPlugin1.shoppingCartDelete.as_view(), A_API + '/shoppingCart/delete'),
        (childrenPlugin1.a_AiConfig_add.as_view(), A_API + '/aAiConfig/add'),
        (childrenPlugin1.a_AiConfig_list.as_view(), A_API + '/aAiConfig/list'),
        (childrenPlugin1.a_AiConfig_update.as_view(), A_API + '/aAiConfig/update'),
        (childrenPlugin1.a_AiConfig_delete.as_view(), A_API + '/aAiConfig/delete'),
        (childrenPlugin1.getSparkDesk.as_view(), A_API + '/sparkDesk/list'),
        (childrenPlugin1.SparkDeskDelete.as_view(), A_API + '/SparkDesk/delete'),
        (childrenPlugin1.getAIPicture.as_view(), A_API + '/aIPicture/list'),
        (childrenPlugin1.AIPictureDelete.as_view(), A_API + '/aIPicture/delete'),
        (childrenPlugin1.AIPictureUpdate.as_view(), A_API + '/aIPicture/update'),
        (childrenPlugin1.couponsUpdate.as_view(), A_API + '/coupons/update'),
        (childrenPlugin1.couponsAdd.as_view(), A_API + '/coupons/add'),
        (childrenPlugin1.couponsList.as_view(), A_API + '/coupons/list'),
        (childrenPlugin1.userCoupons.as_view(), A_API + '/coupons/userCoupons'),
        (childrenPlugin1.sign_in_list.as_view(), A_API + '/sign_in/list'),
        (childrenPlugin1.sign_in_add.as_view(), A_API + '/sign_in/add'),
        (childrenPlugin1.sign_in_update.as_view(), A_API + '/sign_in/update'),
        (childrenPlugin1.sign_in_delete.as_view(), A_API + '/sign_in/delete'),
        (childrenPlugin1.showWorks_list.as_view(), A_API + '/showWorks_list/list'),
        (childrenPlugin1.showWorks_add.as_view(), A_API + '/showWorks_add/add'),
        (childrenPlugin1.showWorks_edit.as_view(), A_API + '/showWorks_edit/edit'),
        (childrenPlugin1.showWorks_delete.as_view(), A_API + '/showWorks_delete/delete'),

        # 小程序功能
        (mallProgram.functionList.as_view(), A_API + '/mallProgram/functionList/list'),
        (mallProgram.functionAdd.as_view(), A_API + '/mallProgram/functionList/add'),
        (mallProgram.functionEdit.as_view(), A_API + '/mallProgram/functionList/edit'),
        (mallProgram.functionDelete.as_view(), A_API + '/mallProgram/functionList/delete'),

    ]

    Cpublic = [
        (wx_userInfo.wechatLogin.as_view(), C_API + '/wxlogin'),
        (wx_userInfo.h5Login.as_view(), C_API + '/h5login'),
        (wx_userInfo.h5LoginRefresh.as_view(), C_API + '/h5LoginRefresh'),
        (order.xiaOrder.as_view(), C_API + '/wechatApi/order/createOrder'),
        (order.getOrderDetails.as_view(), C_API + '/wechatApi/order/getOrderDetails'),
        (order.order_confirm.as_view(), C_API + '/wechatApi/order/order_confirm'),
        (order.order_confirm_status0.as_view(), C_API + '/wechatApi/order/order_confirm_status'),

        # (order.wechatPlaceAnOrder.as_view(), C_API + '/wechatApi/order/placeAnOrder'),
        (wx_userInfo.getWechatConfig.as_view(), C_API + '/wechatApi/getWechatConfig'),
        (pluginChildren.getBanner.as_view(), C_API + '/banner/getBanner'),
        (pluginChildren.getGoods.as_view(), C_API + '/goods/getGoods'),
        (pluginChildren.getGoodsList.as_view(), C_API + '/goods/getGoodsList'),
        (pluginChildren.extJsonGetGoods.as_view(), C_API + '/goods/extJsonGetGoods'),
        (pluginChildren.getCategoryGoods.as_view(), C_API + '/goods/getCategoryGoods'),
        (pluginChildren.getCategoryHome.as_view(), C_API + '/category/getCategoryHome'),
        (pluginChildren.getGoodsDetails.as_view(), C_API + '/goods/getGoodsDetails'),
        (pluginChildren.getGoodsSales.as_view(), C_API + '/goods/getGoodsSales'),
        (pluginChildren.getStore.as_view(), C_API + '/store/getStore'),
        (pluginChildren.getNotice.as_view(), C_API + '/notice/getNotice'),
        (pluginChildren.getCategoryOne.as_view(), C_API + '/category/getCategoryOne'),
        (pluginChildren.getCategoryTow.as_view(), C_API + '/category/getCategoryTow'),
        (pluginChildren.getShoppingCart.as_view(), C_API + '/shoppingCart/getShoppingCart'),
        (pluginChildren.DelShoppingCart.as_view(), C_API + '/shoppingCart/deleteShoppingCart'),
        (pluginChildren.getShoppingCartNum.as_view(), C_API + '/shoppingCart/getShoppingCartNum'),
        (pluginChildren.getOrderList.as_view(), C_API + '/orderList/list'),
        (pluginChildren.getBalance.as_view(), C_API + '/getBalance/list'),
        (pluginChildren.getMemberVip.as_view(), C_API + '/getMemberVip/list'),
        (pluginChildren.serviceGuaranteeList.as_view(), C_API + '/serviceGuaranteeList/list'),
        (pluginChildren.mallGoodsLabel.as_view(), C_API + '/mallGoodsLabel/list'),

        (pluginChildren1.answersSparkDesk.as_view(), C_API + '/SparkDesk/answers'),
        (pluginChildren1.getAnswersSparkDesk.as_view(), C_API + '/SparkDesk/getAnswersSparkDesk'),
        (pluginChildren1.getRechargerecordAi.as_view(), C_API + '/SparkDesk/getRechargerecordAi'),
        (pluginChildren1.searchPicture.as_view(), C_API + '/searchPicture/search'),
        (pluginChildren1.getCoupons.as_view(), C_API + '/getCoupons/list'),
        (pluginChildren1.checkCoupons.as_view(), C_API + '/getCoupons/checkCoupons'),
        (pluginChildren1.getAIPictureList.as_view(), C_API + '/getAIPictureList/list'),
        (pluginChildren1.myCoupons.as_view(), C_API + '/coupons/myCoupons'),
        (pluginChildren1.selectLabel.as_view(), C_API + '/label/selectLabel'),
        (pluginChildren1.signIn_list.as_view(), C_API + '/sign_in/signInList'),
        (pluginChildren1.day_sigin_in.as_view(), C_API + '/sign_in/daySiginIn'),
        (pluginChildren1.play_sigin_in.as_view(), C_API + '/sign_in/playSiginIn'),


        # add 特殊
        (addTherData.addUserAddress.as_view(), C_API + '/address/addUserAddress'),
        (addTherData.addressList.as_view(), C_API + '/address/addressList'),
        (addTherData.deleteUserAddress.as_view(), C_API + '/address/deleteUserAddress'),
        (addTherData.editUserAddress.as_view(), C_API + '/address/editUserAddress'),
        (addTherData.useUserAddress.as_view(), C_API + '/address/useUserAddress'),
        (addTherData.mallFunctionList.as_view(), C_API + '/functionList/list'),
        (addTherData.addUserShoppingCart.as_view(), C_API + '/addUserShoppingCart/add'),
        (addTherData.dianzan.as_view(), C_API + '/dianzan/add'),
        (addTherData.getCouponsData.as_view(), C_API + '/coupons/getCouponsData'),

    ]

    public = [
        (upload.upload.as_view(), A_API + '/uploading'),
        (upload.filemanage_group_add.as_view(), A_API + '/filemanage_group_add'),
        (upload.filemanage_group_list.as_view(), A_API + '/filemanage_group_list'),
        (upload.filemanage_group_delete.as_view(), A_API + '/filemanage_group_delete'),
        (upload.filemanage_group_update.as_view(), A_API + '/filemanage_group_update'),
        (upload.get_file_manage.as_view(), A_API + '/getImage'),
        (upload.ImageDel.as_view(), A_API + '/ImageDel'),
    ]
    url_list = Apublic + Aauthority + Bauthority + Cpublic + public +Aprivate
    return url_list